//
//  ByDocumentaryControlView.m
//  caipiao_ios
//
//  Created by mc on 2018/8/13.
//  Copyright © 2018年 ZhangZhanbin. All rights reserved.
//

#import "ByDocumentaryControlView.h"

@implementation ByDocumentaryControlView

- (id)init{
    self = [super init];
    if (self) {
        self.userInteractionEnabled = YES;
        self.backgroundColor = BY_THEME_COLOR;
        UIImageView *iconView = [[UIImageView alloc] init];
        [self addSubview:iconView];
        [iconView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self).offset(0);
            make.left.equalTo(self).offset(0);
            make.size.mas_equalTo(CGSizeMake(20, 20));
        }];
        
        iconView.image = [UIImage imageNamed:@"weiguanzhu关注"];
        iconView.userInteractionEnabled = YES;
        self.iconView = iconView;
        
        UILabel *titleLabel = [[UILabel alloc] init];
        [self addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(iconView.mas_right).offset(5);
            make.centerY.equalTo(self).offset(0);
            make.right.equalTo(self).offset(0);
            make.height.mas_equalTo(@20);
        }];
        titleLabel.textColor = [UIColor whiteColor];
        titleLabel.font = FONT(12);
        titleLabel.text = @"关注";
        self.titleLabel = titleLabel;
    }
    return self;
}

@end
